<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	<h:outputStylesheet library="css" name="table-style.css" />
</h:head>

<h:body>
	<ui:composition template="/template/common/commonLayout.xhtml">
		<ui:define name="content">
			<h1 style="color: #709FB3;">Spremeni geslo</h1>
			<h:form id="userInfoForm">
				<p:messages id="messages" />
				<table width="100%">
					<tr>
						<h:panelGrid columns="1">
							<td>
								<h:outputText value="Pozdravljen uporabnik #{userInfoController.userDescription}"/>
							</td>
							<td>
								<h:outputText value="Tukaj lahko spremenite svoje geslo"/>
							</td>
						</h:panelGrid>
					</tr>
					<p:spacer width="100%" height="20" />
					<tr>
						<td>
							<h:panelGrid columns="2">
								<h:outputText value="#{translatorService.translate('userInfo.username')}"/>
								<h:inputText value="#{userInfoController.username}" disabled="true" />
				
								<h:outputText value="#{translatorService.translate('userInfo.oldPassword')}" />
								<h:inputSecret value="#{userInfoController.oldPassword}" />
								
								<h:outputText value="#{translatorService.translate('userInfo.newPassword')}" />
								<p:password value="#{userInfoController.newPassword}" />
								
								<h:outputText value="#{translatorService.translate('userInfo.confirmedPassword')}" />
								<p:password value="#{userInfoController.confirmedPassword}" />
							</h:panelGrid>
						</td>
					</tr>
					<tr>
						<td>
							<h:panelGrid columns="1">
								<p:spacer width="100%" height="5"/>
								<p:commandButton value="#{translatorService.translate('userInfo.button.change')}" 
									actionListener="#{userInfoController.updateUser()}" 
									update="messages userInfoForm"/>
							</h:panelGrid>
						</td>
						
					</tr>
				</table>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>

</html>